package com.javasoft.controller.WJC;

import com.javasoft.entity.WJC.StudentAnswer;
import com.javasoft.service.WJC._interface.JudgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/judge")
public class JudgeController {

    @Autowired
    private JudgeService judgeService;
    @PostMapping(value = "/{examId}/{studentId}")
    public StudentAnswer generateExam(@PathVariable Long examId, @PathVariable Long studentId) {
        return judgeService.correctExam(examId, studentId);
    }
    @PostMapping(value = "/{examId}")
    public List<StudentAnswer> generateExam(@PathVariable Long examId) {
        return judgeService.correctExam(examId);
    }

}
